<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.thymeleaf.org/thymeleaf-extras-shiro">


<!--head-->
<div th:fragment="head">
    <meta charset="utf-8" />
    <link rel="apple-touch-icon" sizes="76x76" th:href="@{/img/apple-icon.png}">
    <link rel="icon" type="image/png" th:href="@{/img/favicon.png}">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <title th:text="${title}">

    </title>
    <meta content='width=device-width, initial-scale=1.0, shrink-to-fit=no' name='viewport' />
    <!--     Fonts and icons     -->
    <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Roboto+Slab:400,700|Material+Icons" />
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css">
    <!-- CSS Files -->
    <link th:href="@{/css/material-dashboard.css(v=2.1.2)}" rel="stylesheet" />
    <!-- CSS Just for demo purpose, don't include it in your project -->
    <link th:href="@{/demo/demo.css}" rel="stylesheet" />
</div>
<!--end head-->


<!--sidebar-->
<div th:fragment="sidebar" class="sidebar" data-color="purple" data-background-color="white" data-image="../assets/img/sidebar-1.jpg">
    <!--
      Tip 1: You can change the color of the sidebar using: data-color="purple | azure | green | orange | danger"

      Tip 2: you can also add an image using data-image tag
    -->
    <div class="logo"><a href="http://www.creative-tim.com" class="simple-text logo-normal">
        <shiro:principal property="permission"/>
    </a></div>
    <div class="sidebar-wrapper">
        <ul class="nav">
            <!--shiro:管理者显示-->
            <div shiro:hasPermission="manager">
                <li th:class="${nav=='manager/index'?'nav-item active':'nav-item'}">
                    <a class="nav-link" th:href="@{/manager/toIndex}">
                        <i class="material-icons">dashboard</i>
                        <p>首页</p>
                    </a>
                </li>
                <li th:class="${nav=='manager/patient'?'nav-item active':'nav-item'}">
                    <a class="nav-link" th:href="@{/manager/toPatient}">
                        <i class="material-icons">dashboard</i>
                        <p>病人管理</p>
                    </a>
                </li>
                <li class="">
                    <a class="nav-link" href="">
                        <i class="material-icons">dashboard</i>
                        <p>科室管理</p>
                    </a>
                </li>
                <li th:class="${nav=='manager/doctor'?'nav-item active':'nav-item'}">
                    <a class="nav-link" th:href="@{/manager/toDoctor}">
                        <i class="material-icons">dashboard</i>
                        <p>医师管理</p>
                    </a>
                </li>
                <li th:class="${nav=='manager/res'?'nav-item active':'nav-item'}">
                    <a class="nav-link" th:href="@{/manager/toRes}">
                        <i class="material-icons">dashboard</i>
                        <p>查看所有预约</p>
                    </a>
                </li>

            </div>
            <!--end-->

            <!--shiro:医师显示-->
            <div shiro:hasPermission="doctor">
                <li th:class="${nav=='doctor/index'?'nav-item active':'nav-item'}">
                    <a class="nav-link" th:href="@{/doctor/toIndex}">
                        <i class="material-icons">dashboard</i>
                        <p>首页</p>
                    </a>
                </li>
                <li th:class="${nav=='doctor/res'?'nav-item active':'nav-item'}">
                    <a class="nav-link" th:href="@{/doctor/toRes}">
                        <i class="material-icons">dashboard</i>
                        <p>查看预约</p>
                    </a>
                </li>
                <li th:class="${nav=='doctor/history'?'nav-item active':'nav-item'}">
                    <a class="nav-link" th:href="@{/doctor/toHistory}">
                        <i class="material-icons">dashboard</i>
                        <p>历史就诊</p>
                    </a>
                </li>
            </div>
            <!--end-->

            <!--shiro:病人显示-->
            <div shiro:hasPermission="patient">
                <li th:class="${nav=='patient/index'?'nav-item active':'nav-item'}">
                    <a class="nav-link" th:href="@{/patient/toIndex}">
                        <i class="material-icons">dashboard</i>
                        <p>首页</p>
                    </a>
                </li>
                <li th:class="${nav=='patient/newRes'?'nav-item active':'nav-item'}">
                    <a class="nav-link" th:href="@{/patient/toNewRes}">
                        <i class="material-icons">dashboard</i>
                        <p>预约就诊</p>
                    </a>
                </li>
                <li th:class="${nav=='patient/update'?'nav-item active':'nav-item'}">
                    <a class="nav-link" th:href="@{/patient/toUpdate}">
                        <i class="material-icons">dashboard</i>
                        <p>修改信息</p>
                    </a>
                </li>
            </div>
            <!--end-->
            <!--<li th:class="${nav=='dashboard.html'?'nav-item active':'nav-item'}">
                <a class="nav-link" th:href="@{/toDashboard}">
                    <i class="material-icons">dashboard</i>
                    <p>Dashboard</p>
                </a>
            </li>

            <li th:class="${nav=='user.html'?'nav-item active':'nav-item'}">
                <a class="nav-link" th:href="@{toUser}">
                    <i class="material-icons">person</i>
                    <p>User Profile</p>
                </a>
            </li>
            <li th:class="${nav=='tables.html'?'nav-item active':'nav-item'}">
                <a class="nav-link" th:href="@{/toTables}">
                    <i class="material-icons">content_paste</i>
                    <p>Table List</p>
                </a>
            </li>
            <li th:class="${nav=='typography.html'?'nav-item active':'nav-item'}">
                <a class="nav-link" th:href="@{/toTypography}">
                    <i class="material-icons">library_books</i>
                    <p>Typography</p>
                </a>
            </li>
            <li th:class="${nav=='icons.html'?'nav-item active':'nav-item'}">
                <a class="nav-link" th:href="@{/toIcons}">
                    <i class="material-icons">bubble_chart</i>
                    <p>Icons</p>
                </a>
            </li>
            <li th:class="${nav=='map.html'?'nav-item active':'nav-item'}">
                <a class="nav-link" th:href="@{/toMap}">
                    <i class="material-icons">location_ons</i>
                    <p>Maps</p>
                </a>
            </li>
            <li th:class="${nav=='notifications.html'?'nav-item active':'nav-item'}">
                <a class="nav-link" th:href="@{/toNotifications}">
                    <i class="material-icons">notifications</i>
                    <p>Notifications</p>
                </a>
            </li>
            <li th:class="${nav=='upgrade.html'?'nav-item active-pro active':'nav-item active-pro'}">
                <a class="nav-link" th:href="@{/toUpgrade}">
                    <i class="material-icons">unarchive</i>
                    <p>Upgrade to PRO</p>
                </a>
            </li>-->
        </ul>
    </div>
</div>
<!--end sidebar-->



<!--navbar-->
<nav class="navbar navbar-expand-lg navbar-transparent navbar-absolute fixed-top " th:fragment="navbar">
    <div class="container-fluid">
        <div class="navbar-wrapper">
            <!--<a class="navbar-brand" href="javascript:;">Dashboard</a>-->
        </div>
        <button class="navbar-toggler" type="button" data-toggle="collapse" aria-controls="navigation-index" aria-expanded="false" aria-label="Toggle navigation">
            <span class="sr-only">Toggle navigation</span>
            <span class="navbar-toggler-icon icon-bar"></span>
            <span class="navbar-toggler-icon icon-bar"></span>
            <span class="navbar-toggler-icon icon-bar"></span>
        </button>
        <div class="collapse navbar-collapse justify-content-end">
            <form class="navbar-form">
                <div class="input-group no-border">
                    <input type="text" value="" class="form-control" placeholder="Search...">
                    <button type="submit" class="btn btn-white btn-round btn-just-icon">
                        <i class="material-icons">search</i>
                        <div class="ripple-container"></div>
                    </button>
                </div>
            </form>
            <ul class="navbar-nav">
                <li class="nav-item">
                    <a class="nav-link" href="javascript:;">
                        <i class="material-icons">dashboard</i>
                        <p class="d-lg-none d-md-block">
                            Stats
                        </p>
                    </a>
                </li>
                <li class="nav-item dropdown">
                    <a class="nav-link" href="http://example.com" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        <i class="material-icons">notifications</i>
                        <span class="notification">5</span>
                        <p class="d-lg-none d-md-block">
                            Some Actions
                        </p>
                    </a>
                    <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownMenuLink">
                        <a class="dropdown-item" href="#">Mike John responded to your email</a>
                        <a class="dropdown-item" href="#">You have 5 new tasks</a>
                        <a class="dropdown-item" href="#">You're now friend with Andrew</a>
                        <a class="dropdown-item" href="#">Another Notification</a>
                        <a class="dropdown-item" href="#">Another One</a>
                    </div>
                </li>
                <li class="nav-item dropdown">
                    <a class="nav-link" href="javascript:;" id="navbarDropdownProfile" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        <i class="material-icons">person</i>
                        <p class="d-lg-none d-md-block">
                            Account
                        </p>
                    </a>
                    <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownProfile">
                        <a class="dropdown-item" href="#">Profile</a>
                        <a class="dropdown-item" href="#">Settings</a>
                        <div class="dropdown-divider"></div>
                        <a class="dropdown-item" th:href="@{/logout}">Log out</a>
                    </div>
                </li>
            </ul>
        </div>
    </div>
</nav>
<!--end navbar-->


<!--footer-->
<footer class="footer" th:fragment="footer">
    <div class="container-fluid">
        <nav class="float-left">
            <ul>
                <li>
                    <a href="https://www.creative-tim.com">
                        Creative Tim团队
                    </a>
                </li>
                <li>
                    <a href="https://creative-tim.com/presentation">
                        关于Creative Tim团队
                    </a>
                </li>
                <li>
                    <a href="http://blog.creative-tim.com">
                        博客
                    </a>
                </li>
                <li>
                    <a href="https://www.creative-tim.com/license">
                        开源协议
                    </a>
                </li>
            </ul>
        </nav>
        <div class="copyright float-right">
            &copy;
            <script>
                document.write(new Date().getFullYear())
            </script>, 由 <i class="material-icons">favorite</i>
            <a href="https://www.creative-tim.com" target="_blank">Creative Tim</a> 打造。
        </div>
    </div>
</footer>
<!--end footer-->


<!--fixed-plugin-->
<div class="fixed-plugin" th:fragment="plugin">
    <div class="dropdown show-dropdown">
        <a href="#" data-toggle="dropdown">
            <i class="fa fa-cog fa-2x"> </i>
        </a>
        <ul class="dropdown-menu">
            <li class="header-title"> Sidebar Filters</li>
            <li class="adjustments-line">
                <a href="javascript:void(0)" class="switch-trigger active-color">
                    <div class="badge-colors ml-auto mr-auto">
                        <span class="badge filter badge-purple" data-color="purple"></span>
                        <span class="badge filter badge-azure" data-color="azure"></span>
                        <span class="badge filter badge-green" data-color="green"></span>
                        <span class="badge filter badge-warning" data-color="orange"></span>
                        <span class="badge filter badge-danger" data-color="danger"></span>
                        <span class="badge filter badge-rose active" data-color="rose"></span>
                    </div>
                    <div class="clearfix"></div>
                </a>
            </li>
            <li class="header-title">Images</li>
            <li class="active">
                <a class="img-holder switch-trigger" href="javascript:void(0)">
                    <img th:src="@{/img/sidebar-1.jpg}" alt="">
                </a>
            </li>
            <li>
                <a class="img-holder switch-trigger" href="javascript:void(0)">
                    <img th:src="@{/img/sidebar-2.jpg}" alt="">
                </a>
            </li>
            <li>
                <a class="img-holder switch-trigger" href="javascript:void(0)">
                    <img th:src="@{/img/sidebar-3.jpg}" alt="">
                </a>
            </li>
            <li>
                <a class="img-holder switch-trigger" href="javascript:void(0)">
                    <img th:src="@{/img/sidebar-4.jpg}" alt="">
                </a>
            </li>
            <li class="button-container">
                <a href="https://www.creative-tim.com/product/material-dashboard" target="_blank" class="btn btn-primary btn-block">Free Download</a>
            </li>
            <!-- <li class="header-title">Want more components?</li>
                <li class="button-container">
                    <a href="https://www.creative-tim.com/product/material-dashboard-pro" target="_blank" class="btn btn-warning btn-block">
                      Get the pro version
                    </a>
                </li> -->
            <li class="button-container">
                <a href="https://demos.creative-tim.com/material-dashboard/docs/2.1/getting-started/introduction.html" target="_blank" class="btn btn-default btn-block">
                    View Documentation
                </a>
            </li>
            <li class="button-container github-star">
                <a class="github-button" href="https://github.com/creativetimofficial/material-dashboard" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star ntkme/github-buttons on GitHub">Star</a>
            </li>
            <li class="header-title">Thank you for 95 shares!</li>
            <li class="button-container text-center">
                <button id="twitter" class="btn btn-round btn-twitter"><i class="fa fa-twitter"></i> &middot; 45</button>
                <button id="facebook" class="btn btn-round btn-facebook"><i class="fa fa-facebook-f"></i> &middot; 50</button>
                <br>
                <br>
            </li>
        </ul>
    </div>
</div>
<!--end fixed-plugin-->

<!--公共一类科室联系方式-->
    <div class="card" th:fragment="phone">
        <div class="card-header card-header-warning">
            <h4 class="card-title">紧急联系电话</h4>
            <p class="card-category">这里是一类科室的紧急联系电话</p>
        </div>
        <div class="card-body table-responsive">
            <table class="table table-hover">
                <thead class="text-warning">
                <th>科室编号</th>
                <th>科室名</th>
                <th>紧急电话</th>
                </thead>
                <tbody>
                <tr>
                    <td>1</td>
                    <td>儿科</td>
                    <td>85752015</td>
                </tr>
                <tr>
                    <td>2</td>
                    <td>中医科</td>
                    <td>87523512</td>
                </tr>
                <tr>
                    <td>3</td>
                    <td>眼科</td>
                    <td>85144444</td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
<!--end-->


<!--公共二类科室信息-->
<div class="card" th:fragment="dept2Info">
    <div class="card-header card-header-tabs card-header-primary">
        <div class="nav-tabs-navigation">
            <div class="nav-tabs-wrapper">
                <span class="nav-tabs-title">科室:</span>
                <ul class="nav nav-tabs" data-tabs="tabs">
                    <li class="nav-item">
                        <a class="nav-link active" href="#profile" data-toggle="tab">
                            <i class="material-icons">cloud</i> 儿科
                            <div class="ripple-container"></div>
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#messages" data-toggle="tab">
                            <i class="material-icons">cloud</i> 中医科
                            <div class="ripple-container"></div>
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#settings" data-toggle="tab">
                            <i class="material-icons">cloud</i> 眼科
                            <div class="ripple-container"></div>
                        </a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <div class="card-body table-responsive">
        <div class="tab-content">
            <div class="tab-pane active" id="profile">
                <table class="table">
                    <thead class="text-warning">
                    <th>科室编号</th>
                    <th>科室名</th>
                    </thead>
                    <tbody>
                    <tr>
                        <td>1</td>
                        <td>儿童保健科</td>
                    </tr>
                    <tr>
                        <td>2</td>
                        <td>小儿神经外科</td>
                    </tr>
                    <tr>
                        <td>3</td>
                        <td>小儿神经内科</td>
                    </tr>
                    <tr>
                        <td>4</td>
                        <td>小儿肾内科</td>
                    </tr>
                    <tr>
                        <td>5</td>
                        <td>新生儿科</td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="tab-pane" id="messages">
                <table class="table">
                    <thead class="text-warning">
                    <th>科室编号</th>
                    <th>科室名</th>
                    </thead>
                    <tbody>
                    <tr>
                        <td>6</td>
                        <td>中医骨伤科</td>
                    </tr>
                    <tr>
                        <td>7</td>
                        <td>中医康复科</td>
                    </tr>
                    <tr>
                        <td>8</td>
                        <td>针灸推拿科</td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="tab-pane" id="settings">
                <table class="table">
                    <thead class="text-warning">
                    <th>科室编号</th>
                    <th>科室名</th>
                    </thead>
                    <tbody>
                    <tr>
                        <td>9</td>
                        <td>青光眼科</td>
                    </tr>
                    <tr>
                        <td>10</td>
                        <td>白内障科</td>
                    </tr>
                    <tr>
                        <td>11</td>
                        <td>角膜病科</td>
                    </tr>
                    <tr>
                        <td>12</td>
                        <td>屈光科</td>
                    </tr>
                    <tr>
                        <td>13</td>
                        <td>眼整形科</td>
                    </tr>
                    <tr>
                        <td>14</td>
                        <td>眼底科</td>
                    </tr>
                    <tr>
                        <td>15</td>
                        <td>眼外伤科</td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<!--end-->


<!--   公共JS   -->
<div th:fragment="publicJs">
    <script th:src="@{/js/core/jquery.min.js}"></script>
    <script th:src="@{/js/core/popper.min.js}"></script>
    <script th:src="@{/js/core/bootstrap-material-design.min.js}"></script>
    <script th:src="@{/js/plugins/perfect-scrollbar.jquery.min.js}"></script>
    <!-- Plugin for the momentJs  -->
    <script th:src="@{/js/plugins/moment.min.js}"></script>
    <!--  Plugin for Sweet Alert -->
    <script th:src="@{/js/plugins/sweetalert2.js}"></script>
    <!-- Forms Validations Plugin -->
    <script th:src="@{/js/plugins/jquery.validate.min.js}"></script>
    <!-- Plugin for the Wizard, full documentation here: https://github.com/VinceG/twitter-bootstrap-wizard -->
    <script th:src="@{/js/plugins/jquery.bootstrap-wizard.js}"></script>
    <!--	Plugin for Select, full documentation here: http://silviomoreto.github.io/bootstrap-select -->
    <script th:src="@{/js/plugins/bootstrap-selectpicker.js}"></script>
    <!--  Plugin for the DateTimePicker, full documentation here: https://eonasdan.github.io/bootstrap-datetimepicker/ -->
    <script th:src="@{/js/plugins/bootstrap-datetimepicker.min.js}"></script>
    <!--  DataTables.net Plugin, full documentation here: https://datatables.net/  -->
    <script th:src="@{/js/plugins/jquery.dataTables.min.js}"></script>
    <!--	Plugin for Tags, full documentation here: https://github.com/bootstrap-tagsinput/bootstrap-tagsinputs  -->
    <script th:src="@{/js/plugins/bootstrap-tagsinput.js}"></script>
    <!-- Plugin for Fileupload, full documentation here: http://www.jasny.net/bootstrap/javascript/#fileinput -->
    <script th:src="@{/js/plugins/jasny-bootstrap.min.js}"></script>
    <!--  Full Calendar Plugin, full documentation here: https://github.com/fullcalendar/fullcalendar    -->
    <script th:src="@{/js/plugins/fullcalendar.min.js}"></script>
    <!-- Vector Map plugin, full documentation here: http://jvectormap.com/documentation/ -->
    <script th:src="@{/js/plugins/jquery-jvectormap.js}"></script>
    <!--  Plugin for the Sliders, full documentation here: http://refreshless.com/nouislider/ -->
    <script th:src="@{/js/plugins/nouislider.min.js}"></script>
    <!-- Include a polyfill for ES6 Promises (optional) for IE11, UC Browser and Android browser support SweetAlert -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/core-js/2.4.1/core.js"></script>
    <!-- Library for adding dinamically elements -->
    <script th:src="@{/js/plugins/arrive.min.js}"></script>
    <!--  Google Maps Plugin    -->
    <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_KEY_HERE"></script>
    <!-- Chartist JS -->
    <script th:src="@{/js/plugins/chartist.min.js}"></script>
    <!--  Notifications Plugin    -->
    <script th:src="@{/js/plugins/bootstrap-notify.js}"></script>
    <!-- Control Center for Material Dashboard: parallax effects, scripts for the example pages etc -->
    <script th:src="@{/js/material-dashboard.js(v=2.1.2)}" type="text/javascript"></script>
    <!-- Material Dashboard DEMO methods, don't include it in your project! -->
    <script th:src="@{/demo/demo.js}"></script>
    <script>
        $(document).ready(function() {
            $().ready(function() {
                $sidebar = $('.sidebar');

                $sidebar_img_container = $sidebar.find('.sidebar-background');

                $full_page = $('.full-page');

                $sidebar_responsive = $('body > .navbar-collapse');

                window_width = $(window).width();

                fixed_plugin_open = $('.sidebar .sidebar-wrapper .nav li.active a p').html();

                if (window_width > 767 && fixed_plugin_open == 'Dashboard') {
                    if ($('.fixed-plugin .dropdown').hasClass('show-dropdown')) {
                        $('.fixed-plugin .dropdown').addClass('open');
                    }

                }

                $('.fixed-plugin a').click(function(event) {
                    // Alex if we click on switch, stop propagation of the event, so the dropdown will not be hide, otherwise we set the  section active
                    if ($(this).hasClass('switch-trigger')) {
                        if (event.stopPropagation) {
                            event.stopPropagation();
                        } else if (window.event) {
                            window.event.cancelBubble = true;
                        }
                    }
                });

                $('.fixed-plugin .active-color span').click(function() {
                    $full_page_background = $('.full-page-background');

                    $(this).siblings().removeClass('active');
                    $(this).addClass('active');

                    var new_color = $(this).data('color');

                    if ($sidebar.length != 0) {
                        $sidebar.attr('data-color', new_color);
                    }

                    if ($full_page.length != 0) {
                        $full_page.attr('filter-color', new_color);
                    }

                    if ($sidebar_responsive.length != 0) {
                        $sidebar_responsive.attr('data-color', new_color);
                    }
                });
                $('.fixed-plugin .background-color .badge').click(function() {
                    $(this).siblings().removeClass('active');
                    $(this).addClass('active');

                    var new_color = $(this).data('background-color');

                    if ($sidebar.length != 0) {
                        $sidebar.attr('data-background-color', new_color);
                    }
                });
                $('.fixed-plugin .img-holder').click(function() {
                    $full_page_background = $('.full-page-background');

                    $(this).parent('li').siblings().removeClass('active');
                    $(this).parent('li').addClass('active');


                    var new_image = $(this).find("img").attr('src');

                    if ($sidebar_img_container.length != 0 && $('.switch-sidebar-image input:checked').length != 0) {
                        $sidebar_img_container.fadeOut('fast', function() {
                            $sidebar_img_container.css('background-image', 'url("' + new_image + '")');
                            $sidebar_img_container.fadeIn('fast');
                        });
                    }

                    if ($full_page_background.length != 0 && $('.switch-sidebar-image input:checked').length != 0) {
                        var new_image_full_page = $('.fixed-plugin li.active .img-holder').find('img').data('src');

                        $full_page_background.fadeOut('fast', function() {
                            $full_page_background.css('background-image', 'url("' + new_image_full_page + '")');
                            $full_page_background.fadeIn('fast');
                        });
                    }

                    if ($('.switch-sidebar-image input:checked').length == 0) {
                        var new_image = $('.fixed-plugin li.active .img-holder').find("img").attr('src');
                        var new_image_full_page = $('.fixed-plugin li.active .img-holder').find('img').data('src');

                        $sidebar_img_container.css('background-image', 'url("' + new_image + '")');
                        $full_page_background.css('background-image', 'url("' + new_image_full_page + '")');
                    }

                    if ($sidebar_responsive.length != 0) {
                        $sidebar_responsive.css('background-image', 'url("' + new_image + '")');
                    }
                });

                $('.switch-sidebar-image input').change(function() {
                    $full_page_background = $('.full-page-background');

                    $input = $(this);

                    if ($input.is(':checked')) {
                        if ($sidebar_img_container.length != 0) {
                            $sidebar_img_container.fadeIn('fast');
                            $sidebar.attr('data-image', '#');
                        }

                        if ($full_page_background.length != 0) {
                            $full_page_background.fadeIn('fast');
                            $full_page.attr('data-image', '#');
                        }

                        background_image = true;
                    } else {
                        if ($sidebar_img_container.length != 0) {
                            $sidebar.removeAttr('data-image');
                            $sidebar_img_container.fadeOut('fast');
                        }

                        if ($full_page_background.length != 0) {
                            $full_page.removeAttr('data-image', '#');
                            $full_page_background.fadeOut('fast');
                        }

                        background_image = false;
                    }
                });

                $('.switch-sidebar-mini input').change(function() {
                    $body = $('body');

                    $input = $(this);

                    if (md.misc.sidebar_mini_active == true) {
                        $('body').removeClass('sidebar-mini');
                        md.misc.sidebar_mini_active = false;

                        $('.sidebar .sidebar-wrapper, .main-panel').perfectScrollbar();

                    } else {

                        $('.sidebar .sidebar-wrapper, .main-panel').perfectScrollbar('destroy');

                        setTimeout(function() {
                            $('body').addClass('sidebar-mini');

                            md.misc.sidebar_mini_active = true;
                        }, 300);
                    }

                    // we simulate the window Resize so the charts will get updated in realtime.
                    var simulateWindowResize = setInterval(function() {
                        window.dispatchEvent(new Event('resize'));
                    }, 180);

                    // we stop the simulation of Window Resize after the animations are completed
                    setTimeout(function() {
                        clearInterval(simulateWindowResize);
                    }, 1000);

                });
            });
        });
    </script>
</div>
<!--end publicJs-->
</html>